﻿@{
    ViewData["Title"] = "Home Page";
}

<div class="text-center">
    <h1 class="display-4">Welcome</h1>
    <p>Learn about <a href="https://docs.microsoft.com/aspnet/core">building Web apps with ASP.NET Core</a>.</p>
</div>
<table class="table table-striped table-hover">
    <thead>
        <tr>
            <th>商品编号</th>
            <th>商品名称</th>
            <th>商品价格</th>
            <th>删除</th>
            
        </tr>
    </thead>
    <tbody>
        @foreach (var item in Model)
        {
        <tr>
            <td>@item.ProductId</td>
            <td>@item.ProductName</td>
            <td>@string.Format("{0:C}元", item.ProductPrice)</td>
            <td><a href="/Home/Remove/@item.ProductId" class="btn btn-danger" onclick="return confirm('确定要删除吗？')">删除</a></td>
       </tr>
        }
    </tbody>
</table>